// Header Protection
#ifndef _EVENTARG_H_
#define _EVENTARG_H_

/////////////////////////////////////////////////////////////////////////////////////
// A base class from which to derive in order to pass data in an event argument.
class CEventArg
{
public:     // methods

	inline CEventArg() : m_iRefCount(0) { }

	// Add a reference to the event argument.
	inline void AddRef()
	{
		++m_iRefCount;
	}

	// Remove a reference from the event arguments, delete them if there are 
	//     no more references.
	inline void Release()
	{
		if( --m_iRefCount == 0 )
			delete this;
	}

protected:  // child methods
	virtual inline ~CEventArg() { }

private:    // data
	int_t m_iRefCount;

private:    // dummy definitions
	CEventArg( CEventArg const & );
	CEventArg &operator =( CEventArg const & );
};

// Header Protection
#endif // _EVENTARG_H_
